<template>
  <div class="righttopcontainer">
    <div class="top">毕业薪资分布</div>
    <div id="main" ref="rightRight"></div>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import * as echarts from 'echarts';
import { onMounted } from 'vue';
const rightRight = ref()


const option = {
  title: {
    left: 'center'
  },
  tooltip: {
    trigger: 'item'
  },
  legend: {
    orient: 'vertical',
    left: 'left'
  },
  series: [
    {
      name: 'Access From',
      type: 'pie',
      radius: '50%',
      data: [
        { value: 1048, name: 'Search Engine' },
        { value: 735, name: 'Direct' },
        { value: 580, name: 'Email' },
        { value: 484, name: 'Union Ads' },
        { value: 300, name: 'Video Ads' }
      ],
      emphasis: {
        itemStyle: {
          shadowBlur: 10,
          shadowOffsetX: 0,
          shadowColor: 'rgba(0, 0, 0, 0.5)'
        }
      }
    }
  ]
};

onMounted(() => {
  const Charts = echarts.init(rightRight.value);
  Charts.setOption(option)
})
</script>

<style scoped lang="scss">
.righttopcontainer {
  width: 100%;
  height: 48%;
  font-size: 0.0877rem;
  margin-top: 10px;
}

#main {
  width: 100%;
  height: 100%;
}

.top {
  width: 94%;
  height: 0.1875rem;
  background: red;
  background: url(../../../assets/右.png) no-repeat 0 0 /100% 100%;
  padding-left: 20px;
  line-height: 0.1875rem;
  color: #9eb2fc;
}
</style>